package com.chrray.position.entity.position;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chrray.position.domain.FdUser;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Transient;
import java.time.LocalDateTime;

/**
 * @author LM
 * @date 2024/8/29 10:59
 */
@Data
public class FdUserExe<T> extends FdUser {

    @DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ApiModelProperty(value = "开始时间", example = "2018-10-10 20:20:20")
    @Transient
    @TableField(exist = false)
    private LocalDateTime startTime;
    @DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    @ApiModelProperty(value = "结束时间", example = "2020-10-10 20:20:20")
    @Transient
    @TableField(exist = false)
    private LocalDateTime endTime;

    @TableField(exist = false)
    @JsonIgnore
    @Transient
    private int pageNum = 1;

    /***
     * 页面数量
     */
    @TableField(exist = false)
    @JsonIgnore
    @Transient
    private int pageSize = 10;



    @ApiModelProperty(value = "期望薪资开始,元")
    @TableField(exist = false)
    @Transient
    private Integer expectedSalaryStart;

    @ApiModelProperty(value = "期望薪资结束,元")
    @TableField(exist = false)
    @Transient
    private Integer expectedSalaryEnd;
    @ApiModelProperty(value = "期望薪资")
    @TableField(exist = false)
    @Transient
    private Integer expectedSalary;

    @ApiModelProperty(value = "职位id")
    @TableField(exist = false)
    @Transient
    private Long postingsId;
    @ApiModelProperty(value = "竞聘状态:1-待录用/2-已录用/3-已完工")
    @TableField(exist = false)
    @Transient
    private Integer jobState;

    public IPage<T> getPage() {
        Page<T> objectPage = new Page<>();
        objectPage.setCurrent(pageNum);
        objectPage.setSize(pageSize);
        return objectPage;
    }
}

